<template>
<div id="transform">
  <button @click="isShow=!isShow">当点击显示</button>
  <transition name="hello" :appear="true">
    <h1 v-show="isShow">动画</h1>
  </transition>

</div>
</template>

<script>
//借助过渡实现
export default {
  name: "transform",
  data(){
    return {
      isShow:true
    }
  }
}
</script>

<style scoped>
  h1{
    background: orange;
    transition: 0.5s linear;
  }
  .hello-enter,.hello-leave-to{
    transform: translateX(-100%);
  }
  .hello-enter-to,.hello-leave{
    transform: translateX(0);
  }

</style>
